package com.uzai.console.web.wechatwork;

import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import com.github.xiaoymin.knife4j.annotations.ApiSort;
import com.uzai.console.annotation.SystemLogType;
import com.uzai.console.dto.wechatwork.wxq.wxgorupblacklist.baseconfig.WxqWorkBlacklistBaseConfigDto;
import com.uzai.console.enums.OperationTypeEnum;
import com.uzai.console.enums.SystemModelEnum;
import com.uzai.console.service.wechatwork.WxqWorkBlacklistBaseService;
import com.uzai.console.vo.wechatwork.wxq.wxgroupblacklist.baseconfig.WxqWorkBlacklistBaseConfigVo;
import com.uzai.console.web.BaseController;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

/**
 * 企业微信社群黑名单基础设置
 * @author liuqi
 * @date 2021年08月16日 15:11
 */
@Api(value = "企业微信社群黑名单基础设置",tags = "企业微信|社群黑名单|基础设置")
@ApiSort(6)
@RestController
public class WxqWorkBlacklistBaseConfigController extends BaseController {
    private Logger logger = LoggerFactory.getLogger(WxqWorkBlacklistBaseConfigController.class);

    @Autowired
    private WxqWorkBlacklistBaseService wxqWorkBlacklistBaseService;

    @ApiOperation(value = "查询社群黑名单基础设置信息", notes = "查询社群黑名单基础设置信息", response = WxqWorkBlacklistBaseConfigVo.class)
    @ApiOperationSupport(order = 1)
    @PostMapping("/wxqWorkBlacklistBaseConfig/findWxqWorkBlacklistConfig")
    public Object findWxqWorkBlacklistConfig(){
        return wxqWorkBlacklistBaseService.findWxqWorkBlacklistConfig(getLoginInfo().getMerId());
    }

    @SystemLogType(model = SystemModelEnum.WxqWorkBlacklistBase, type = OperationTypeEnum.UPDATE)
    @ApiOperation(value = "修改社群黑名单基础设置信息", notes = "修改社群黑名单基础设置信息")
    @ApiOperationSupport(order = 2)
    @PostMapping("/wxqWorkBlacklistBaseConfig/updateWxqWorkBlacklistConfig")
    public Object updateWxqWorkBlacklistConfig(@RequestBody WxqWorkBlacklistBaseConfigDto wxqWorkBlacklistBaseConfigDto){
        wxqWorkBlacklistBaseService.updateWxqWorkBlacklistConfig(wxqWorkBlacklistBaseConfigDto);
        return true;
    }

}
